<?php

namespace XWAM\Addon\POrgCustomer\Model;

/**
 * CallRecordModel 类
 *
 * @since VER:1.0; DATE:2016-1-23; AUTHOR:SoChishun; EMAIL:14507247@qq.com; DESC:Added.
 */
class CallRecordModel extends \XWAM\Model\AppbaseModel {
    protected $tableName='t_porg_callrecord';
    
    /**
     * 获取分机最近通话10条记录
     * @param type $exten
     * @param type $field
     * @param type $limit
     * @return type
     * @since VER:1.0; DATE:2016-2-1; AUTHOR:SoChishun; EMAIL:14507247@qq.com; DESC:Added.
     */
    function get_exten_call_records($exten,$field='line,create_time',$limit=10){
        return $this->field($field)->where(array('exten'=>$exten,'direction'=>1))->order('id desc')->limit($limit)->select();
    }
}
